/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sys.screen;

import com.sun.awt.AWTUtilities;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.Frame;
import javax.swing.*;

/**
 *
 * @author Cesar Daniel
 */
public class BarraProgresso extends javax.swing.JDialog {

    private final JWindow jWindow;
    private Frame jFrame;
    private Dialog dialog;
    private javax.swing.JPanel jPanel1;
    public javax.swing.JLabel lbDescricao;
    private javax.swing.JLabel lbMetro;

    public BarraProgresso(java.awt.Frame parent) {
        super(parent);
        jFrame = parent;
        jWindow = new JWindow(jFrame);
    }

    public BarraProgresso(java.awt.Dialog parent) {
        super(parent);
        dialog = parent;
        jWindow = new JWindow(dialog);
    }

    public void gerarJanela() {

        jPanel1 = new javax.swing.JPanel();
        lbMetro = new javax.swing.JLabel();
        lbDescricao = new javax.swing.JLabel();
        lbDescricao.setHorizontalAlignment(JLabel.CENTER);
        lbMetro.setHorizontalAlignment(JLabel.CENTER);


        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(BorderFactory.createLineBorder(new Color(153, 255, 255), 1));

        lbMetro.setForeground(new java.awt.Color(18, 1, 18));
        lbMetro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sys/picture/metro.GIF"))); 

        lbDescricao.setBackground(new java.awt.Color(0, 255, 255));
        lbDescricao.setFont(new java.awt.Font("Calibri", 1, 12)); // NOI18N
        lbDescricao.setForeground(new java.awt.Color(153, 153, 153));
        lbDescricao.setText("CARREGANDO, POR FAVOR AGUARDE...");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false).addComponent(lbDescricao, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(lbMetro, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(lbDescricao).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(lbMetro).addGap(23, 23, 23)));


        jWindow.add(jPanel1);
        jWindow.pack();
        jWindow.setLocationRelativeTo(null);
        AWTUtilities.setWindowOpacity(jWindow, 0.85f);  
        jWindow.setVisible(true);   
    }

    public void fechar() {
        jWindow.dispose();
    }
}
